﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using FlashCards.Model;

namespace FlashCards.WebApp.Models
{
    public class SetUserGroupRoleModel
    {
        public SetUserGroupRoleModel(User user, Group group, string userRole, List<GroupRole> roles)
        {
            User = new UserModel(user);
            Group = new GroupModel(group);
            UserRole = userRole;

            GroupRoles = new List<GroupRoleModel>();
            foreach (var item in roles)
                GroupRoles.Add(new GroupRoleModel { Id = item.GroupRoleId, Name = item.Name });
        }

        public UserModel User { get; set; }
        public GroupModel Group { get; set; }
        public string UserRole { get; set; }

        public List<GroupRoleModel> GroupRoles { get; set; }
    }
}